package com.lyq.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 用户事件监听
 */
@Slf4j
@Component
public class UserMonitor2 {

//    @Async("lazyTraceExecutor")
//    @EventListener(UserActionEvent.class)
    public void addUser(UserActionEvent event) {
        log.info("监听到用户事件2:{}, currentThread:{}", event, Thread.currentThread());
    }

//    @Async("lazyTraceExecutor")
//    @EventListener(UserActionEvent.class)
    public void addUser3(UserActionEvent event) {
        log.info("监听到用户事件3:{}, currentThread:{}", event, Thread.currentThread());
    }
}
